<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
		<title>登录</title>
		<link rel="stylesheet" type="text/css" href="../css/gh-login.css"/>
		<script src="../js/gh-login.js"></script>
	</head>
	<body>
		<header>
			<a href="gh-qidong.html">取消</a>
			<h2>登录</h2>
		</header>
		<section>
			<div class="mask"></div>
			<div class="wrap">
				<div class="photo"><img src="../img/gh-房子.png"/></div>
				<div class="font"><img src="../img/gh-字.png"/></div>
				<div class="xian"><img src="../img/gh-艺术线.png"/></div>
			</div>
			<form action="" method="post">
				<div class="shurubox">
					<div class="zh">
						<span>账号</span><input type="text" value="" placeholder="请输入手机号码"/>
					</div>
					<div class="fgxian"></div>
					<div class="mm">
						<span>密码</span><input type="password" value="" placeholder="请输入密码">
					</div>
				</div>
				<input type="submit" id="" name="" value="登录" />
			</form>
			<div class="zhuceAndmima clearfix">
				<a class="fl" href="gh-zhuce.html">用户注册</a>
				<a class="fr" href="gh-wjpwd.html">忘记密码</a>
			</div>
		</section>
		<footer>
			<a href="">
				<div class="wx">
					<img src="../img/icon_微信-logo.png"/><span>微信登录</span>
				</div>
			</a>
			<div class="fgxian2"></div>
			<a href="">
				<div class="qq">
					<img src="../img/qq (1).png"/><span>QQ登录</span>
				</div>
			</a>
			
		</footer>
		<script type="text/javascript">
			function clickk(){
				var mk = document.querySelector(".mask");
				var sub = document.querySelector("input[type='submit']");
				var h = document.querySelector("h2");
				var text1 = document.querySelector("input[type='text']");
				var text2 = document.querySelector("input[type='password']");
				console.log(text1);
				h.onclick=function(){
					open="gh-qidong.html";
				}
				sub.addEventListener("click",function(e){
					e.preventDefault();
					if(text1.value==''){
						mk.innerText="账号不能为空";
						mk.style="display:block";
						setTimeout(function(){
                            mk.style="display:none";
						},1500)
					}
					if(isNaN(text1.value)){
						mk.innerText="账号格式不正确";
						mk.style="display:block";
						setTimeout(function(){
                            mk.style="display:none";
						},1500)
					}
					if(text2.value==''){
						mk.innerText="密码不能为空";
						mk.style="display:block";
						setTimeout(function(){
                            mk.style="display:none";
						},1500)
					}
					if(text1.value != "" && text2.value != ""){
						location.href = "DP_index.html"
					}
				})
			}
			clickk();
		</script>
	</body>
</html>
